<?php

/**
 * @see Base
 */
require_once LIB_PATH . 'Base.php';


/**
 * DataModel 
 * 
 * @uses Base
 * @author Pablo López Torres <pablolopeztorres@gmail.com> 
 */
abstract class DataModel extends Base {

    /**
     * identifier 
     * 
     * @var string|NULL
     * @access private
     */
    private $identifier = NULL;

    /**
     * identify
     * 
     * @access public
     * @author Pablo López Torres <pablolopeztorres@gmail.com> 
     * @param mixed $identifier 
     * @return void
     */
    public function identify($identifier)
    {
        $this->identifier = $identifier;
    }

    /**
     * getIdentifier
     * 
     * @access protected
     * @author Pablo López Torres <pablolopeztorres@gmail.com> 
     * @return string Identifier used by this model
     */
    public function getIdentifier()
    {
        return $this->identifier;
    }

    /**
     * getPersistentKey
     * 
     * @abstract
     * @access public
     * @author Pablo López Torres <pablolopeztorres@gmail.com> 
     * @param string $element 
     * @return string
     */
    abstract public function getPersistentKey($element);

}


class ElementNotIdentifiedException extends Exception
{
}

